<template>
	<el-row class="welifo">
		<div v-if="this.$store.state.islogin">
			<el-col :span="12" class="xianyu">
			<h2>{{this.$store.state.username}}</h2>
		
			  <el-button type="warning" @click="dologin">退出登陆</el-button>
		  
		    </el-col>
		</div>
		
		<div v-else>
			<el-col :span="12" class="xianyu">
			<h2>欢迎来到闲鱼</h2>
			<router-link to="/">
			  <el-button type="warning">马上登陆</el-button>
		    </router-link>
		    </el-col>
		</div>
		<el-col :span="12">
			<div class="logo"></div>
		</el-col>
	</el-row>


</template>


<script>
	export default {
		name:'welifo',
		methods:{
			dologin(){
				this.$store.commit('dologout');
				this.$router.push('/');
			}
		}
		// components:{welifo}
	}
</script>


<style>
    .xianyu{
    	padding-left: 0px;
    	left: 0;
		

    }
    .welifo{
    	width: 700px;
    	margin:0 auto;
    }
	.logo{
		
		background-image: url(../assets/1.jpg);
		width:120px;
		height: 80PX;
		margin-top: 30px;
	}
</style>